package cn.edu.zut.service;

import cn.edu.zut.dao.BookTypeDao;
import cn.edu.zut.model.Book;
import cn.edu.zut.model.BookType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookTypeServiceImpl implements BookTypeService {

    @Autowired
    BookTypeDao bookTypeDao;

    public int addBookType(BookType bookType) {
        return bookTypeDao.insertBookType(bookType);
    }

    public int deleteBookType(BookType bookType) {
        return bookTypeDao.deleteBookType(bookType);
    }

    public int updateBookType(BookType bookType) {
        return bookTypeDao.updateBookType(bookType);
    }

    public List<BookType> select_All_BookType() {
        return bookTypeDao.select_All_BookType();
    }

    public int selectIdByTypeName(String typename) {
        return bookTypeDao.selectIdByTypeName(typename);
    }
}
